package com.subdemo.wordmachine.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.subdemo.wordmachine.domain.Type;
import com.subdemo.wordmachine.mapper.TypeMapper;
import com.subdemo.wordmachine.service.TypeService;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class TypeServiceImpl extends ServiceImpl<TypeMapper, Type> implements TypeService {

    /**
     * 获取全部词性:前端添加单词下拉栏数据
     */
    public List<String> getAllType() {
        List<String> types = new ArrayList<>();
        List<Type> all = this.list();
        for (Type one :all) {
            types.add(one.getType());
        }
        return types;
    }


}
